#include <stdio.h>
#include <stdlib.h>

//#define DEBUG

void sort_quick(unsigned *a, unsigned n);

int main(int argc, char **argv)		//if chang all the unsigned into int, cause the last test site error 
{
	unsigned n, p, *in;
	unsigned i, j, mark = 0, max;
	unsigned count = 0, max_count = 0;
	
	scanf("%d%d", &n, &p);

	in = (unsigned*)malloc(sizeof(unsigned)*n);
	for(i = 0; i < n; i++)
		scanf("%d", in+i);
	
	sort_quick(in, n);

#ifdef DEBUG
	for(i = 0; i < n; i++)
		printf("%d ", in[i]);
	printf("\n");
#endif

	for(i=0, j=0; i < n; i++)
	{
		max = in[i]*p;

		for(j; in[j] <= max; j++)
		{
			count++;
			if(j == n-1)
			{
				mark = 1;
				break;
			}
		}

		if(count > max_count)
			max_count = count;

		count--;
		if(mark)
			break;
	}

	printf("%d\n", max_count);
	return 0;
}

unsigned pick(unsigned *a, unsigned head, unsigned tail)
{
	unsigned i = head;
	unsigned j = tail;
	unsigned key = a[head];

	while(i != j)
	{
		if(a[j] < key)
		{
			a[i] = a[j];
			while(1)
			{
				i++;
				if(i == j)
					break;

				if(a[i] > key)
				{
					a[j] = a[i];
					j--;
					break;
				}
			}
		}
		else
			j--;
	}
	a[j] = key;

	return i;
}
void quicksort(unsigned *a, unsigned head, unsigned tail)
{
	unsigned pos = 0;

	if(head < tail)
	{
		pos = pick(a, head, tail);
		quicksort(a, head, pos);
		quicksort(a, pos+1 , tail);
	}
}
void sort_quick(unsigned *a, unsigned n)	//quick sort
{
	quicksort(a, 0, n-1);
}